<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>按键修饰符</title>
</head>
<body>
  <div id="app">
    <input type="text" @keyup.enter="submit" @keyup.esc="clearInput">
  </div>
  <script src="./code/lib/vue-2.6.12.js"></script>
  <script>
    const vm=new Vue({
      el:'#app',
      methods: {
        submit(e){
          console.log('按下enter键,最新的值是'+e.target.value)
        },
        clearInput(e){
          e.target.value=''
        }
      },
    })
  </script>
</body>
</html>